/* チーム選択セクション */
.team-selection {
    display: flex;
    justify-content: center; /* 水平中央揃え */
    align-items: center; /* 垂直中央揃え */
    gap: 10px; /* ラベルとプルダウンの間のスペース */
    padding: 10px;
    background-color: #f0f0f0;
    width: 100%; /* 親要素に合わせる */
    box-sizing: border-box;
    margin-top:15px;
  }
  .team-selection label {
    font-size: 16px;
  }
  .team-selection select {
    padding: 5px 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
  }

/* ベーススタイル */
.players {
    display: flex;
    gap: 10px; /* 右カラムと左カラムの間の余白 */
    margin-top: 30px;
}

/* 左右カラム */
.left-column,
.right-column {
    display: flex;
    flex-direction: column; /* 縦方向に積む */
}

.left-column {
    width: 130px; /* 左カラム幅を固定 */
    flex-shrink: 0; /* 左カラムが縮まないようにする */
    gap: 10px; /* AとDの間に余白 */
}

/* 各エリア */
.A { }
/*Bエリア 選手名------------------------------------------------ */
.B { }
.name {
    height: 38px;
    line-height:38px;
    padding-left:10px;
    color:#fff;
}
.name-kanji {
    font-weight: bold; /* 太字 */
    font-size: 24px; /* 文字サイズ */
    margin-right: 10px; /* 伊達となつのの間に余白を追加 */
}
.name-hiragana {
    font-size: 16px; /* レギュラーウェイトのサイズ */
}
.bat-throw  {
    height: 28px;
    line-height:28px;
    padding-left:10px;
    font-size: 16px;
    color:#000;
}
/*Dエリア 投手野手共通　守備パラメーター（ただし野手用はAに入る）--------------------------------------------------------- */
.df0, .df1, .df2, .df3, .df4, .df5, .df6, .df7, .df8 { position: absolute; }
.df0 { left: 55px; top: 64px; }
.df1 { left: 55px; top: 97px; }
.df2 { left: 89px; top: 63px; }
.df3 { left: 70px; top: 42px; }
.df4 { left: 21px; top: 63px; }
.df5 { left: 40px; top: 42px; }
.df6 { left: 19px; top: 18px; }
.df7 { left: 55px; top: 4px; }
.df8 { left: 91px; top: 18px; }
.D {
    display: flex;
    flex-direction: column; /* 縦方向に並べる */
    gap: 0; /* 上下の余白なし */
    width: 100%; /* 横幅を100%に設定 */
}
.D1, .D2 {
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    justify-content: space-between; /* 左に文字、右に画像を配置 */
    height: 30px; /* 高さを30pxに設定 */
    font-size: 16px; /* 文字サイズを16pxに設定 */
    padding: 0 5px; /* 左右に10pxのパディングを設定 */
    box-sizing: border-box; /* パディングを含めて幅を計算 */
}
.D1 { background-color: #f1f1f1; }
.D2 { background-color: #e5e5e5; }
/* 野手レイアウトの時のみ有効 */
.A > .D { margin-top:10px; }


/* Eエリア 投手用　変化球パラメーター --------------------------------------------------------- */
.E {
    position:relative;
    border:solid 2px #c2c2c2;
    height:190px;
    background-image: url('../ダイナマイト野球　選手名鑑_files/pitch_type.jpg'); /* 背景画像のURL */
    background-repeat: no-repeat; /* 繰り返しを無効化 */
    background-position: calc(50%) 79px;
    background-size: auto; /* 必要に応じてサイズ調整（例: cover, contain） */
}
.henka-title {position:absolute; top:0; left:0; width:100%; height:30px; line-height:30px; background: #c2c2c2; text-align:center;}
/* 各変化球の名前の位置の指定 */
.henka-name {
    position: absolute;
    width: 100px;
    height: 24px;
    background-color: #e5e5e5;
    line-height: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: normal;
    color: #000;
}
.henka1 { left: calc(50% - 50px); top: 44px; }
.henka2 { left: calc(50% - 166px); top: 77px; }
.henka3 { left: calc(50% - 152px); top: 116px; }
.henka4 { left: calc(50% - 50px); top: 152px; }
.henka5 { left: calc(50% + 52px); top: 116px; }
.henka6 { left: calc(50% + 66px); top: 77px; }
/* 能力数値の位置 */
.henka-num { position: absolute;}
.hk2 { left: calc(50% - 60px); top: 74px; }
.hk3 { left: calc(50% - 50px); top: 104px; }
.hk4 { left: calc(50% - 17px); top: 118px; }
.hk5 { left: calc(50% + 16px); top: 104px; }
.hk6 { left: calc(50% + 26px); top: 74px; }

/* Fエリア 投手用　バッティングパラメーター --------------------------------------------------------- */
.F {
    display: grid;
    grid-template-rows: repeat(4, 34px); /* モバイル用：縦方向の4行 */
    gap: 0; /* 上下方向の余白なし */
}

.F1, .F2, .F3, .F4 {
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    justify-content: space-between; /* テキストと画像を両端に配置 */
    font-size: 18px; /* テキストサイズ */
    height: 34px; /* 各行の高さ */
    line-height: 34px; /* 垂直方向のテキスト中央揃え */
    position: relative; /* 画像位置調整の基準 */
    border-bottom: 2px solid #c2c2c2; /* 下部のアンダーライン */
}

.F1 img, .F2 img, .F3 img, .F4 img {
    position: absolute;
    right: 0; /* 右端に配置 */
    top: 50%; /* 垂直方向の中央 */
    transform: translateY(-50%); /* 高さ中央に調整 */
}

/* 特殊能力　--------------------------------------------------------- */
.special_ablty {
    grid-column: 1 / -1; /* 左端から右端までの全幅を占有 */
    grid-row: auto; /* 新しい行に配置 */
    padding: 10px;
    font-size:18px;
    background: #e5e5e5; /* 背景色 */
    text-align: left; /* 左寄せ */
    border-bottom: 2px solid #5c5c5c; /* 下線 */
}
.special_ablty span { white-space: nowrap; color:#003cff;}
.special_ablty span.sp_red {color:#e60012;}
.special_ablty span.sp_gray {color:#777;}

/* Gエリア　野手用　ピッチングパラメーター--------------------------------------------------------- */
.G {
    grid-column: span 2; /* Cの全幅を使用 */
    display: grid;
    width: 100%; /* 横幅を100% */
    gap: 10px; /* カラム間の余白 */
}
.G1_param {
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    justify-content: space-between;
    font-size: 18px;
    height: 32px;
    line-height: 32px;
    position: relative;
    border-bottom: 2px solid #c2c2c2;
}
.G1_param img {
    position: absolute;
    right: 0; /* 右端に配置 */
    top: 50%; /* 垂直方向の中央 */
    transform: translateY(-50%); /* 高さ中央に調整 */
}
.G1_param:first-of-type { border-top: 2px solid #c2c2c2; }
.G2 {
    position:relative;
    border:solid 2px #c2c2c2;
    height:100px;
    background-image: url('../ダイナマイト野球　選手名鑑_files/pitch_type.jpg'); /* 背景画像のURL */
    background-repeat: no-repeat; /* 繰り返しを無効化 */
    background-position: calc(50%) 30px;
    background-size: auto; /* 必要に応じてサイズ調整（例: cover, contain） */
    text-align:center;
}
.G2 > .hk2 { left: calc(50% - 48px); top: 26px; }
.G2 > .hk3 { left: calc(50% - 38px); top: 54px; }
.G2 > .hk4 { left: calc(50% - 10px); top: 66px; }
.G2 > .hk5 { left: calc(50% + 18px); top: 54px; }
.G2 > .hk6 { left: calc(50% + 28px); top: 26px; }


/* モバイル用レイアウト \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
@media (max-width: 767px) {
    .players {
        display: grid;
        grid-template-columns: 130px 1fr; /* 左カラムを130pxに固定 */
        gap:10px; /* アイテム間のスペース */
        grid-template-areas:
            "B B"  /* Bが左右100% */
            "A C"  /* A左、C右 */
            "E E"  /* Eが左右100% */
            "special_ablty special_ablty"
            "D F"; /* D左、F右 */
    }

    .left-column {
        width: 130px; /* 左カラム幅を固定 */
    }

    .left-column,
    .right-column {
        display: contents; /* グリッドに合わせて中身だけ表示 */
    }

    .A { grid-area: A; }
    .B { grid-area: B; }
    .C { grid-area: C; }
    .D { grid-area: D; }
    .E { grid-area: E; margin-top:-10px;}
    .F { grid-area: F; }

    /* Cエリア　メインパラメータ　投手・野手共通--------------------------------------------------------- */
    .C1, .C2, .C3, .C4 {
        padding-left: 10px;
        height:40px;
        line-height:40px;
        font-size:20px;
        background: #e5e5e5; /* 背景色 */
        text-align: left; /* 左寄せ */
        border-bottom: 2px solid #5c5c5c; /* 下線 */
        position: relative; /* 画像配置のための基準 */
        margin-bottom: 10px; /* 各要素の間に余白 */
    }
    /* 野手バージョンのみ */
    .C > .special_ablty { margin:10px 0; }

    .F1 { border-top: 2px solid #c2c2c2;}

    /* Gエリア　野手用ピッチングパラメーター--------------------------------------------------------- */
    .G {
        grid-template-columns: 1fr; /* スマホでは1列表示 */
        grid-template-rows: auto auto; /* 上から縦に並べる */
    }
}

/* デスクトップ用レイアウト \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
@media (min-width: 768px) {
    .players {
        display: flex;
        gap: 10px; /* 右カラムと左カラムの間の余白 */
        flex-direction: row; /* 横方向に並べる */
    }

    .left-column {
        flex-shrink: 0; /* 左カラムが縮まないようにする */
        width: 130px; /* 左カラム幅を固定 */
        display: flex;
        flex-direction: column; /* 縦方向に積む */
        gap: 10px; /* AとDの間に余白 */
    }

    .right-column {
        flex: 2; /* 右カラム幅 */
        display: flex;
        flex-direction: column; /* 縦方向に積む */
        gap: 10px; /* B, C, E, Fの間に余白 */
    }

    /* Cエリア　メインパラメータ　投手・野手共通--------------------------------------------------------- */
    .C {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 左カラムと右カラム */
        grid-template-rows: 1fr auto auto; /* 2行目にC4を追加 */
        grid-template-areas: 
            "C1 C2" /* C1とC2を左右に配置 */
            "C3 C4"; /* C3左下、C4右下 */
        gap: 10px; /* C1とC2、C1とC3、C2とC4の間の余白 */
        align-items: stretch; /* 行内の高さを揃える */
        margin-bottom:-10px; /* gapの重複分を吸収 */
    }
    .C1 { grid-area: C1; } /* 左上 */
    .C2 { grid-area: C2; } /* 右上 */
    .C3 { grid-area: C3; } /* 左下 */
    .C4 { grid-area: C4; } /* 右下 */

    /* Fエリア 投手用　バッティングパラメーター --------------------------------------------------------- */
    .F {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2列表示 */
        grid-template-rows: repeat(2, 34px); /* 2行に分割 */
        grid-template-areas: 
            "F1 F2" /* F1とF2を左右に配置 */
            "F3 F4"; /* F3とF4を左右に配置 */
        gap: 0 10px; /* 横方向のカラム間に10pxの余白、上下方向の余白はなし */
    }

    .F1 { grid-area: F1; border-top: 2px solid #c2c2c2;}
    .F2 { grid-area: F2; border-top: 2px solid #c2c2c2;}
    .F3 { grid-area: F3; }
    .F4 { grid-area: F4; }

    .F1, .F2, .F3, .F4 {
        border-bottom: 2px solid #c2c2c2; /* アンダーラインを維持 */
    }

    /* Gエリア　野手用ピッチングパラメーター--------------------------------------------------------- */
    .G {
        grid-template-columns: 1fr 1fr; /* デスクトップでは2列 */
        grid-template-rows: auto; /* 高さを自動調整 */
    }
}

/* Cエリア　メインパラメータ　投手・野手共通--------------------------------------------------------- */
.C1,.C2,.C3,.C4 {
    padding-left: 10px;
    height:40px;
    line-height:40px;
    font-size:20px;
    background: #e5e5e5; /* 背景色 */
    text-align: left; /* 左寄せ */
    border-bottom: 2px solid #5c5c5c; /* 下線 */
    position: relative; /* 画像配置のための基準 */
}

.C1 img,.C2 img,.C3 img,.C4 img {
    position: absolute;
    right: 5px; /* 右端に配置 */
    top: 50%; /* 垂直方向で中央揃え */
    transform: translateY(-50%); /* 高さ中央に揃える */
    width: 34px;
    height: 29px;
}
